package com.lidong.framework.web;

import java.util.List;

import com.lidong.framework.model.BasePojo;
import com.lidong.framework.model.Grid;
import com.lidong.framework.mybatis.query.ConditionQuery;
import com.lidong.framework.mybatis.query.condition.Condition;
import com.lidong.framework.service.SchService;
import org.springframework.beans.factory.annotation.Autowired;

import com.lidong.framework.dal.SchDao;

public class SchController<Pojo extends BasePojo, Service extends SchService<Pojo, ? extends SchDao<Pojo>>>
	extends BaseController {
	
	protected Service service;

	@Autowired
	private void setService(Service service) {
		this.service = service;
	}

	/**
	 * 分页
	 * @param grid
	 * @param query
	 * @return
	 */
	public Grid listGrid(Grid grid, ConditionQuery query){
		return service.listGrid(grid, query);
	}

	public Grid listGrid(Grid grid) {
		return service.listGrid(grid);
	}

	public Grid listGrid(Grid grid, List<Condition> appendConditions) {
		return service.listGrid(grid, appendConditions);
	}
}
